import org.junit.Assert;
import org.junit.Test;


public class SchoolTest {
	public static void main(String a[]){
		SchoolUI sc = new SchoolUI();
		sc.main();
		
		
//		SchoolManager sm = new SchoolManager();
//		try {
//			sm.addPerson(new Student("나마에", "123", "111"));
//		} catch (DuplicatedException e) {
//			e.printStackTrace();
//		}
//		
//		Person p = new Student("변경된나마에", "123", "111111");
//		sm.updatePerson(p);
	}
	
	@Test
	public void searchTest(){
		SchoolManager sm = new SchoolManager();
		try {
			sm.addPerson(new Person("아이작0", "123"));
		} catch (DuplicatedException e) {
			e.printStackTrace();
		}
		
		Assert.assertEquals(sm.searchPerson("123").getName(), "아이작0");
	}
	
	@Test
	public void deleteTest(){
		SchoolManager sm = new SchoolManager();
		try {
			sm.addPerson(new Person("아이작0", "123"));
		} catch (DuplicatedException e) {
			e.printStackTrace();
		}
		
		Assert.assertTrue(sm.deletePerson("123"));
	}
	
	
}
